package com.webware.view.client.app.presenter;

import com.google.gwt.user.client.ui.IsWidget;
import com.google.inject.Singleton;
import com.mvp4g.client.annotation.Presenter;
import com.mvp4g.client.presenter.BasePresenter;
import com.webware.view.client.app.AppEventBus;
import com.webware.view.client.app.presenter.interfaces.IAppView;
import com.webware.view.client.app.presenter.interfaces.IAppView.IAppPresenter;
import com.webware.view.client.app.view.AppView;

@Singleton
@Presenter(view = AppView.class)
public class AppPresenter extends BasePresenter<IAppView, AppEventBus>
	implements IAppPresenter {

    public void onSetHeader(IsWidget header) {
	view.setHeader(header);
    }

    public void onSetBody(IsWidget body) {
	view.setBody(body);
    }

    public void onInit() {
	eventBus.goToMainPage("welcome");
    }

    public void onChangeBody(IsWidget w) {
	view.setBody(w);
    }

    public void onGoBack() {
	eventBus.getHistory().back();
    }
}
